package com.syx.commoncore.enums;


import lombok.Setter;

public enum Resultcode {
    /** 定义状态码 */

    //操作唱功
    SUCCESS                     (1000, "操作成功"),

    //服务器内部错误，友好提示
    ERROR                       (2000, "服务繁忙请稍后重试"),

    //操作失败，但是服务器不存在异常
    FAILED                      (3000, "操作失败"),
    FAILED_UNAUTHORIZED         (3001, "未授权"),
    FAILED_PARAMS_VALIDATE      (3002, "参数校验失败"),
    FAILED_NOT_EXISTS           (3003, "资源不存在"),
    FAILED_ALREADY_EXISTS       (3004, "资源已存在"),
    FAILURE_PARSING_TOKEN       (3005,"token解析失败"),

    AILED_USER_EXISTS           (3101, "用户已存在"),
    FAILED_USER_NOT_EXISTS      (3102, "用户不存在"),
    FAILED_LOGIN                (3103, "账号或密码错误"),
    FAILED_USER_BANNED          (3104, "您已被列入黑名单, 请联系管理员."),
    FAILED_INSERT               (3105,"插入失败"),
    FAILED_DELETE               (3106,"删除失败"),
    FAILURE_USER_PHONE          (3111,"您输入的不是一个手机号"),



    ERROR_SERVICES(3107,"服务出现异常，请联系管理员"),
    EXAM_EARLY_START(3108,"竞赛时间不能早于当前时间"),
    EXAM_LATE_BEFORE_OVER(3109,"竞赛结束时间不能早于或等于开始时间"),
    EXAM_NOT_EXIST(3201,"竞赛不存在"),
    EXAM_QUESTION_NOT_EXIST(3202,"为竞赛新增的题目不存在"),
    EXAM_STARTED(3301,"竞赛已经开始，无法进行操作"),
    EXAM_NOT_HAS_QUESTION(3302,"竞赛未关联题目，请先关联题目"),
    EXAM_IS_PUBLISHED(3303,"竞赛已经发布，无法进行编辑删除操作"),



    PUBLISH_FAILURE(3401,"竞赛发布失败"),
    REGISTER_FAILURE(3501,"注册失败"),



    EMAIL_CODE_ERROR(3601,"皇上，请核实您的QQ邮箱验证码是否正确！"),
    EMAIL_FAILURE(3611,"邮箱格式不正确"),
    USER_EXAM_HAS_ENTER (3602,"用户已经报过名了"),

    FAILED_FILE_UPLOAD(3701,"文件上传失败"),
    FAILED_FILE_UPLOAD_TIME_LIMIT(3702,"文件上传次数达到限额"),
    FAILED_FIRST_QUESTION   (3703,"当前题目已经是第一题了"),
    FAILED_LAST_QUESTION   (3704,"当前题目已经是最后一题了"),
    FAILED_SUPPORT_PROGRAM(3705,"当前不支持该语言"),
    FAILED_RABBIT_PRODUCE(3801,"rabbitmq消息发送失败")
    ;


    int code;
    String message;


    Resultcode(int code,String message){
        this.code=code;
        this.message=message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }


    @Override
    public String toString() {
        return "Resultcode{" +
                "code=" + code +
                ", message='" + message + '\'' +
                '}';
    }
}
